next up previous
Next: Conclusions Up: 4 The Effects of Previous: 4.6 Xt Argument Lists

4.7 Extension Writers Beware

Client libraries for X extensions are particularly prone to 64-bit portability problems because X client library code performs the task of correctly converting to and from the API world of C types to the protocol world's fixed protocol fields. It is not surprising that some X extension client library code in the X11R6 distribution (the X Input extension library is an example) was not 64-bit clean.

If an X extension client library is compiled 64-bit but is not actually 64-bit clean, the likely result is X protocol errors, though unreported incorrect results or crashes are also possible.

For the X extension client library author, be sure to use the Data32, Data16, and Data macros for writing appropriately sized protocol data, and use the _XRead32, _XRead16, and _XRead routines for reading appropriately sized protocol data ( Data and _XRead are for 8-bit data). Also, inspect the X11R6 Xlibint.h header file and see how the LONG64 and WORD64 compile flags are used. LONG64 is defined by 64-bit environments using the LP64 data type model, i.e., the long data type is 64 bits long. WORD64 is defined by 64-bit environments using the ILP64 data type model, i.e., the int data type is 64 bits long.



next up previous
Next: Conclusions Up: 4 The Effects of Previous: 4.6 Xt Argument Lists



Mark Kilgard
Sat Dec 30 11:52:07 PST 1995